<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px; 
            list-style: none;
        }
        .tab{
            width: 500px;
            margin: 0 auto;
        }
        li{
            width: 100px;
            height: 35px;
            border: 1px solid #333;
            display: inline-block;
            text-align: center;
            border-bottom: 0px;
            position: relative;
            top: 1px;
            margin-right: 20px;
            line-height: 35px;
        }
        .tab>div{
            height: 300px;
            line-height: 300px;
            border: 1px solid #333;
            text-align: center;
            display: none;
        }
        li.current{
            background: lightcoral;
            border-bottom: lightcoral;
        }
        div.current{
            display: block;
            background: lightcoral;
        }
    </style>
</head>
<body>
    <div class="tab">
        <ul>
            <li class="current">音乐1</li>
            <li>音乐2</li>
            <li>音乐3</li>
        </ul>
        <div class="current">音乐1</div>
        <div>音乐2</div>
        <div>音乐3</div>

    </div>
</body>
</html>
<script>
    var olis=document.querySelectorAll(".tab li");
    var odivs=document.querySelectorAll(".tab div");

    for(var i=0;i<olis.length;i++){
        olis[i].index=i;
        olis[i].onclick=function(){
            for(var j=0;j<olis.length;j++){
            olis[j].classList.remove("current");
            odivs[j].classList.remove("current");
            }
            var index=this.index;
            olis[index].classList.add("current");
            odivs[index].classList.add("current");
        }
    }
</script>       